package com.so.studyonline.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 静恩强
 * @apiNote 配置请求拦截器
 */
@Configuration
public class LoginInterceptorConfig implements WebMvcConfigurer {

    /**
     * @apiNote 实现addInterceptors
     */
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/**").excludePathPatterns(
                "/",
                "/favicon.ico"
        );
    }
}